package io.github.zatter.qiniucorejava.config;

import dev.langchain4j.model.chat.StreamingChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiStreamingChatModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.Duration;

/**
 * {@code @Author: soyo}
 * {@code @Description: }
 * {@code @Create: 2025/9/23}
 */
@Configuration
@Slf4j
public class ModelConfiguration {

    @Bean
    public StreamingChatLanguageModel streamingChatModel() {
        return OpenAiStreamingChatModel.builder()
                .apiKey("sk-610453bad9743dfb294ae3234ada68874c4c1640e6c4cd716dfac043a774eb21")
                .modelName("x-ai/grok-4-fast")
                .baseUrl("https://openai.qiniu.com/v1")
                .temperature(0.8)
                .maxTokens(1000)
                .timeout(Duration.ofSeconds(30))
                .build();
    }

}
